<?php

namespace App\Controllers;

class Route
{
    public function getConstantRoutes(){
        $routes = [
            [
                "name"=>"login",
                "path"=>"/login/:module(pwd-login|code-login|register|reset-pwd|bind-wechat)?",
                "component"=>"layout.blank\$view.login",
                "props"=>true,
                "meta"=>[
                    "title"=>"login","i18nKey"=>"route.login","constant"=>true,"hideInMenu"=>true
                ]
            ],
            [
                "name"=>"403",
                "path"=>"/403",
                "component"=>"layout.blank\$view.403",
                "meta"=>[
                    "title"=>"403","i18nKey"=>"route.403","constant"=>true,"hideInMenu"=>true
                ]
            ],
            [
                "name"=>"404",
                "path"=>"/404",
                "component"=>"layout.blank\$view.404",
                "meta"=>[
                    "title"=>"404","i18nKey"=>"route.404","constant"=>true,"hideInMenu"=>true
                ]
            ],
            [
                "name"=>"500",
                "path"=>"/500",
                "component"=>"layout.blank\$view.500",
                "meta"=>[
                    "title"=>"500","i18nKey"=>"route.500","constant"=>true,"hideInMenu"=>true
                ]
            ]
        ];
        echo json_encode(["result"=>['data'=>$routes,'error'=>''],"status"=>1,"msg"=>"ok"]);
    }

    public function isRouteExist(){
//        routeName
        echo json_encode(["result"=>["data"=>true,'error'=>''],"status"=>1,"msg"=>"ok"]);
    }
}